﻿@model SisGAC.Models.CongressoViewModel

@{
    ViewBag.Title = "Cadastro de Congresso";
}
@Styles.Render("~/Content/themes/base/css")
<h2>Cadastro de Congresso</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Congresso</legend>

        @Html.HiddenFor(model => model.Congresso.CongressoId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.Titulo)
            @Html.ValidationMessageFor(model => model.Congresso.Titulo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.Coordenador)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.CoordenadorId, Model.Coordenadores, "")
            @Html.ValidationMessageFor(model => model.Congresso.Coordenador)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.Local)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.Local)
            @Html.ValidationMessageFor(model => model.Congresso.Local)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataInicioSubmissao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataInicioSubmissao)
            @Html.ValidationMessageFor(model => model.Congresso.DataInicioSubmissao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataFimSubmissao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataFimSubmissao)
            @Html.ValidationMessageFor(model => model.Congresso.DataFimSubmissao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataInicioAvaliacao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataInicioAvaliacao)
            @Html.ValidationMessageFor(model => model.Congresso.DataInicioAvaliacao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataFimAvaliacao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataFimAvaliacao)
            @Html.ValidationMessageFor(model => model.Congresso.DataFimAvaliacao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataInicioCongresso)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataInicioCongresso)
            @Html.ValidationMessageFor(model => model.Congresso.DataInicioCongresso)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.DataFimCongresso)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.DataFimCongresso)
            @Html.ValidationMessageFor(model => model.Congresso.DataFimCongresso)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Congresso.NumeroArtigos)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Congresso.NumeroArtigos)
            @Html.ValidationMessageFor(model => model.Congresso.NumeroArtigos)
        </div>

        <p>
            <input type="submit" value="Salvar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jqueryui")
<script type="text/javascript">
    $(function () {
        var congressoId = "@Model.Congresso.CongressoId";
        if (congressoId == 0)
            $("input[type=datetime]").val('');
        $("input[type=datetime]").datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'dd-mm-yy'
        });
        $("input[type=datetime]").datepicker("option",
                $.datepicker.regional["pt-BR"]);
    });
    
</script>
}
